import * as echarts from 'echarts';

export function echart1(x, y1, y2) {
  return {
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow",
      },
    },
    axisLabel: {
      color: "#fff",
      fontSize: "12",
    },
    legend: {
      //这个颜色没找到怎么变------------------
      data: ["男性", "女性"],
      // 距离底部距离设置
      // right: "0%",
      top: "0",
      //小图标宽度设置
      itemWidth: 15,
      itemHeight: 15,
      //图例组件文字样式
      textStyle: {
        color: "rgb(255,255,255,1)",
      },
      icon: "rect",
    },
    toolbox: {
      show: true,
      orient: "vertical",
      left: "right",
      top: "center",
    },
    grid: {
      top: '15%',
      left: "5%",
      right: "5%",
      bottom: "5%",
      containLabel: true,
    },
    xAxis: [{
      type: "category",
      axisLabel: {
        textStyle: {
          color: "#fff", //坐标值得具体的颜色
          fontSize: 10,
        },
      },
      axisLine: {
        lineStyle: {
          type: "solid",
          color: "#42a4ff", //左边线的颜色
          width: "1", //坐标线的宽度
        },
      },
      axisTick: {
        show: false
      },
      data: x,
    }, ],
    yAxis: [{
      type: "value",
      axisTick: {
        show: false
      },
      axisLine: {
        lineStyle: {
          type: "solid",
          color: "#42a4ff", //左边线的颜色
          width: "1", //坐标线的宽度
        },
      },
      splitLine: {
        lineStyle: {
          color: "#42a4ff",
          width: 0.5,
        },
      },
    }, ],
    series: [{
        name: "男性",
        type: "bar",
        barGap: 0,
        emphasis: {
          focus: "series",
        },
        data: y1,
        itemStyle: {
          normal: {
            //渐变色--------------------
            color: new echarts.graphic.LinearGradient(
              0,
              1,
              0,
              0,
              [{
                  offset: 0,
                  color: "#033cff", // 0% 处的颜色
                },
                {
                  offset: 0.4,
                  color: "#0270ff", // 60% 处的颜色
                },
                {
                  offset: 1,
                  color: "#01b0ff", // 100% 处的颜色
                },
              ],
              false
            ),
            // 圆柱radius------------------
          },
        },
        //圆柱宽度-----------------------------
        barWidth: "26%",
      },
      {
        name: "女性",
        type: "bar",
        emphasis: {
          focus: "series",
        },
        data: y2,
        itemStyle: {
          normal: {
            color: new echarts.graphic.LinearGradient(
              0,
              1,
              0,
              0,
              [{
                  offset: 0,
                  color: "#ff0144", // 0% 处的颜色
                },
                {
                  offset: 0.4,
                  color: "#ff0275", // 60% 处的颜色
                },
                {
                  offset: 1,
                  color: "#ff03a2", // 100% 处的颜色
                },
              ],
              false
            ),
          },
        },
        barWidth: "26%",
      },
    ],
  };
}
export function echart2(data) {
  return {
    tooltip: {
      trigger: "item",
      formatter: "{a} <br/>{b} : {c} ({d}%)",
    },
    legend: {
      orient: "horizontal",
      left: 10,
      //   top: 40,
      bottom: 0,
      textStyle: {
        //图例文字的样式
        color: ["#77c8ff"],
        fontSize: 12,
      },
    },
    series: [{
      color: ["#77c8ff", "#e68e79", "#2dd087", "#a279e6"],
      type: "pie",
      radius: "55%",
      center: ["50%", "40%"],
      radius: ["25%", "40%"],
      data: data,
      label: {
        show: true,
        fontSize: "14",
        fontWeight: "normal",
        color: "#fff",
      },
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: "rgba(0, 0, 0, 0.5)",
        },
      },
    }, ],
  };
}
export function echart3(x, y1, y2) {
  return {
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow",
      },
    },
    axisLabel: {
      color: "#fff",
      fontSize: "12",
    },
    grid: {
      top: "20%",
      left: "5%",
      right: "5%",
      bottom: "5%",
      containLabel: true,
    },
    legend: {
      //这个颜色没找到怎么变------------------
      data: ['男性', '女性'],
      // 距离底部距离设置
      right: "10%",
      left: "40%",
      top: "0%",
      //小图标宽度设置
      itemWidth: 15,
      itemHeight: 15,
      //图例组件文字样式
      textStyle: {
        color: "rgb(255,255,255,1)"
      }
    },
    toolbox: {
      show: true,
      orient: "vertical",
      left: "right",
      top: "center",
    },
    xAxis: [{
      type: "category",
      axisTick: {
        show: false
      },
      data: x,
    }, ],
    yAxis: [{
      type: "value",
      axisLine: {
        show: false,
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,.1)",
          width: 2,
        },
      },
    }, ],
    series: [{
        name: "男性",
        type: "bar",
        barGap: 0,
        label: {},
        emphasis: {
          focus: "series",
        },
        data: y1,
        itemStyle: {
          normal: {
            //渐变色--------------------
            color: new echarts.graphic.LinearGradient(
              0,
              1,
              0,
              0,
              [{
                  offset: 0,
                  color: "#033cff", // 0% 处的颜色
                },
                {
                  offset: 0.4,
                  color: "#0270ff", // 60% 处的颜色
                },
                {
                  offset: 1,
                  color: "#01b0ff", // 100% 处的颜色
                },
              ],
              false
            ),
            // 圆柱radius------------------
          },
        },
        //圆柱宽度-----------------------------
        barWidth: "26%",
      },
      {
        name: "女性",
        type: "bar",
        label: {},
        emphasis: {
          focus: "series",
        },
        data: y2,
        itemStyle: {
          normal: {
            color: new echarts.graphic.LinearGradient(
              0,
              1,
              0,
              0,
              [{
                  offset: 0,
                  color: "#ff0144", // 0% 处的颜色
                },
                {
                  offset: 0.4,
                  color: "#ff0275", // 60% 处的颜色
                },
                {
                  offset: 1,
                  color: "#ff03a2", // 100% 处的颜色
                },
              ],
              false
            ),
          },
        },
        barWidth: "26%",
      },
    ],
  }
}
export function echart4(data) {
  return {
    color: [
      "#1d75f0",
      "#ff701a",
      "#ffa11a",
      "#ffea00",
      "#00a8ff",
      "#3fffea",
      "#00e436",
    ],
    tooltip: {
      trigger: "item",
    },
    legend: {
      // 距离底部距离设置
      right: "10%",
      left: "80%",
      bottom: "25%",
      //小图标宽度设置
      itemWidth: 10,
      itemHeight: 10,
      //图例组件文字样式
      textStyle: {
        color: "rgb(255,255,255,1)",
      },
    },
    grid: {
      left: "5%",
      right: "5%",
      bottom: "5%",
      containLabel: true,
    },
    series: [{
      type: "pie",
      radius: ["40%", "70%"],
      avoidLabelOverlap: false,
      center: ["35%", "45%"],
      label: {
        show: false,
        position: "center",
      },
      emphasis: {
        label: {
          show: false,
          fontSize: "20",
          fontWeight: "bold",
        },
      },
      labelLine: {
        show: false,
      },
      data: data,
    }],
  };
}
export function echart5(data) {
  return {
    tooltip: {
      trigger: "item",
      formatter: " {b}:{c} ",
    },
    color: ["#00d0f5", "#942bca", "#ff3b3b"], //环形颜色
    series: [{
      name: "",
      type: "pie",
      radius: "50%",
      center: ["50%", "50%"],
      radius: ["30%", "45%"],
      labelLine: {
        //图形外文字线
        normal: {
          length: 25,
          length2: 60,
        },
      },
      label: {
        show: true,
        fontSize: "14",
        fontWeight: "normal",
        color: "#fff",
        formatter: "{c|{c}亩}  \n  {b|{b}}", //图形外文字上下显示
        borderWidth: 20,
        borderRadius: 4,
        padding: [0, -60], //文字和图的边距
        rich: {
          b: {
            //name 文字样式
            fontSize: 16,
            lineHeight: 30,
          },
          c: {
            //value 文字样式
            fontSize: 16,
            lineHeight: 30,
            // color: 'red',
            align: "center",
          },
        },
      },
      data: data,
    }, ],
  }
}
export function echart6() {
  return {
    tooltip: {
      trigger: "item",
      formatter: " {b}:{c} ",
    },
    grid: {
      left: "0%",
      right: "0%",
      bottom: "0%",
      top: "0%",
      containLabel: false,
    },
    series: [{
        startAngle: 45,
        color: ["#e2ec34", "#395667"],
        name: "",
        type: "pie",
        radius: "50%",
        center: ["50%", "50%"],
        radius: ["40%", "55%"],
        labelLine: {
          //图形外文字线
          normal: {
            length: 30,
            length2: 30,
          },
        },
        label: {
          show: true,
          fontSize: "14",
          fontWeight: "normal",
          color: "#fff",
          formatter: "{c|{c}亩}  \n  {b|{b}}", //图形外文字上下显示
          borderWidth: 20,
          borderRadius: 4,
          padding: [0, -30], //文字和图的边距
          rich: {
            b: {
              //name 文字样式
              fontSize: 14,
              lineHeight: 30,
            },
            c: {
              //value 文字样式
              fontSize: 14,
              lineHeight: 30,
              // color: 'red',
              align: "center",
            },
          },
        },
        data: [{
            value: 1034,
            name: "村庄面积"
          },
          {
            value: 1234,
            name: "商用地",
            label: {
              show: false,
              formatter: "", //图形外文字上下显示
            },
          },
        ],
      },
      {
        startAngle: 45,
        color: ["#395667", "#e2ec34"],
        name: "",
        type: "pie",
        radius: "50%",
        center: ["50%", "50%"],
        radius: ["20%", "30%"],
        labelLine: {
          //图形外文字线
          length: 60,
          length2: 30,
        },
        label: {
          show: true,
          fontSize: "14",
          fontWeight: "normal",
          color: "#fff",
          formatter: "{c|{c}亩}  \n  {b|{b}}", //图形外文字上下显示
          borderWidth: 20,
          borderRadius: 4,
          padding: [0, -30], //文字和图的边距
          rich: {
            b: {
              //name 文字样式
              fontSize: 14,
              lineHeight: 30,
            },
            c: {
              //value 文字样式
              fontSize: 14,
              lineHeight: 30,
              // color: 'red',
              align: "center",
            },
          },
        },
        data: [{
            value: 1034,
            name: "农用地2",
            label: {
              show: false,
              formatter: "", //图形外文字上下显示
            },
          },
          {
            value: 1234,
            name: "耕地面积",
          },
        ],
      },
    ],
  }
}
export function echart7() {
  return {
    tooltip: {
      trigger: "item",
      formatter: " {b}:{c} ",
    },
    grid: {
      left: "0%",
      right: "0%",
      bottom: "0%",
      top: "0%",
      containLabel: false,
    },
    series: [{
        startAngle: 45,
        color: ["#e2ec34", "#395667"],
        name: "",
        type: "pie",
        radius: "50%",
        center: ["50%", "50%"],
        radius: ["40%", "55%"],
        labelLine: {
          //图形外文字线
          normal: {
            length: 30,
            length2: 30,
          },
        },
        label: {
          show: true,
          fontSize: "14",
          fontWeight: "normal",
          color: "#fff",
          formatter: "{c|{c}亩}  \n  {b|{b}}", //图形外文字上下显示
          borderWidth: 20,
          borderRadius: 4,
          padding: [0, -30], //文字和图的边距
          rich: {
            b: {
              //name 文字样式
              fontSize: 14,
              lineHeight: 30,
            },
            c: {
              //value 文字样式
              fontSize: 14,
              lineHeight: 30,
              // color: 'red',
              align: "center",
            },
          },
        },
        data: [{
            value: 1034,
            name: "养殖"
          },
          {
            value: 1234,
            name: "0",
            label: {
              show: false,
              formatter: "", //图形外文字上下显示
            },
          },
        ],
      },
      {
        startAngle: 45,
        color: ["#395667", "#e2ec34"],
        name: "",
        type: "pie",
        radius: "50%",
        center: ["50%", "50%"],
        radius: ["20%", "30%"],
        labelLine: {
          //图形外文字线
          length: 60,
          length2: 30,
        },
        label: {
          show: true,
          fontSize: "14",
          fontWeight: "normal",
          color: "#fff",
          formatter: "{c|{c}亩}  \n  {b|{b}}", //图形外文字上下显示
          borderWidth: 20,
          borderRadius: 4,
          padding: [0, -30], //文字和图的边距
          rich: {
            b: {
              //name 文字样式
              fontSize: 14,
              lineHeight: 30,
            },
            c: {
              //value 文字样式
              fontSize: 14,
              lineHeight: 30,
              // color: 'red',
              align: "center",
            },
          },
        },
        data: [{
            value: 1034,
            name: "00",
            label: {
              show: false,
              formatter: "", //图形外文字上下显示
            },
          },
          {
            value: 1234,
            name: "种植",
          },
        ],
      },
    ],
  }
}
export function echart8(data) {
  return {
    //图标颜色
    color: ["#2889fe", "#2cd1c0", "#ffa06c", "#fedb65"],
    tooltip: {
      trigger: "item",
    },
    legend: {
      orient: "vertical",
      // 距离底部距离设置
      right: "20%",
      left: "70%",
      bottom: "40%",
      //小图标宽度设置
      itemWidth: 12,
      itemHeight: 12,
      //图例组件文字样式
      textStyle: {
        color: "rgb(255,255,255,1)",
      },
    },
    series: [{
      name: "",
      type: "pie",
      //调整大小
      radius: ["40%", "70%"],
      //饼状图位置
      center: ["35%", "55%"],
      avoidLabelOverlap: false,
      label: {
        show: false,
        position: "center",
      },
      emphasis: {
        label: {
          show: false,
          fontSize: "40",
          fontWeight: "bold",
        },
      },
      labelLine: {
        show: false,
      },
      data: data,
    }, ],
  }
}
export function echart9(x, y) {
  return {
    tooltip: {
      trigger: "axis",
      axisPointer: {
        // 坐标轴指示器，坐标轴触发有效
        type: "shadow", // 默认为直线，可选为:'line' | 'shadow'
      },
    },
    grid: {
      left: "5%",
      right: "5%",
      bottom: "5%",
      top: "5%",
      containLabel: true,
    },
    axisLabel: {
      color: "#fff",
      fontSize: "12",
    },
    xAxis: [{
      type: "category",
      data: x,
      axisTick: {
        alignWithLabel: true,
      },
    }, ],
    yAxis: [{
      type: "value",
      axisLabel: {
        color: "#fff",
        fontSize: "12",
      },
      axisLine: {
        show: false,
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,.1)",
          width: 2,
        },
      },
    }, ],
    series: [{
      type: "bar",
      barWidth: "60%",
      data: y,
      itemStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(
            0,
            1,
            0,
            0,
            [{
                offset: 0,
                color: "#3cb8f9", // 0% 处的颜色
              },
              {
                offset: 0.4,
                color: "#55c2fb", // 60% 处的颜色
              },
              {
                offset: 1,
                color: "#77cffe", // 100% 处的颜色
              },
            ],
            false
          ),
        },
      },
      barWidth: "26%",
    }, ],
  }
}
export function echart10(data) {
  return {
    tooltip: {
      trigger: "item",
      formatter: "{a} <br/>{b}: {c} ({d}%)",
    },
    legend: {
      // data: ["第一产业", "第二产业", "第三产业"],
      orient: "vertical",
      right: "10%",
      bottom: "20%",
      textStyle: {
        color: "#00c0ee",
        fontSize: 16,
      },
    },
    series: [{
        color: ["#00c0ee", "#942bca", "#1d75f0"],
        name: "产业占比",
        type: "pie",
        selectedMode: "single",
        radius: [0, "40%"],
        center: ["30%", "50%"],
        label: {
          position: "inner",
          fontSize: 12,
        },
        labelLine: {
          show: false,
        },
        data: data,
        label: {
          show: false,
        },
      },
      {
        name: "产业占比",
        type: "pie",
        radius: ["65%", "90%"],
        center: ["30%", "50%"],
        label: {
          show: false,
        },
        labelLine: {
          show: false,
        },

        data: data,
        label: {
          show: false,
        },
      },
    ],
  }
}
export function echart11(x, y) {
  return {
    tooltip: {
      trigger: "axis",
    },
    grid: {
      left: "5%",
      right: "5%",
      bottom: "5%",
      top: "5%",
      containLabel: true,
    },
    xAxis: {
      type: "category",
      data: x,
      axisTick: {
        show: false,
      },
      axisLine: {
        //y轴
        show: false,
      },
      axisLabel: {
        color: "#fff",
      },
      splitLine: {
        show: false
      }, //去除网格线
    },
    yAxis: {
      type: "value",
      axisTick: {
        show: false,
      },
      axisLine: {
        //y轴
        show: false,
      },
      axisLabel: {
        color: "#fff",
      },
      splitLine: {
        lineStyle: {
          color: ["rgba(255,255,255,0.3)"],
          width: 1,
        },
      },
    },
    series: [{
      type: "line",
      data: y,
      itemStyle: {
        normal: {
          color: "#66ddff",
          lineStyle: {
            color: "#66ddff",
          },
        },
      },
    }, ],
  }
}
export function echart12(data) {
  return {
    tooltip: {
      trigger: "item",
      formatter: "{a} <br/>{b}: {c} ({d}%)",
    },
    legend: {
      icon: "pin",
      orient: "vertical",
      right: "0",
      bottom: "0",
      itemWidth: 10,
      itemHeight: 10,
      textStyle: {
        color: "#00c0ee",
        fontSize: 10,
      },
    },

    series: [{
      color: ["#ffea00", "#ff701a", "#f89f6a", "#1d75f0", "#3fffea"],
      name: "行业类别",
      type: "pie",
      radius: ["30%", "70%"],
      center: ["30%", "50%"],
      roseType: "area",
      itemStyle: {
        borderRadius: 0,
      },
      label: {
        show: false,
      },
      data: data,
    }, ],
  }
}
export function echart13() {
  return {
    legend: {
      x: "left", //x轴方向在左边显示
      // 距离底部距离设置
      left: "65%",
      top: "5%",
      //小图标宽度设置
      itemWidth: 10,
      itemHeight: 10,
      //图例组件文字样式
      textStyle: {
        color: "rgb(255,255,255,1)",
      },
    },
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow",
      },
    },
    axisLabel: {
      color: "#fff",
      fontSize: "12",
    },
    grid: {
      top: "20%",
      left: "5%",
      right: "5%",
      bottom: "5%",
      containLabel: true,
    },
    toolbox: {
      show: true,
      orient: "vertical",
      left: "right",
      top: "center",
    },
    xAxis: [{
      type: "category",
      axisTick: {
        show: false
      },
      data: ["2012", "2013", "2014", "2015", "2016"],
    }, ],
    yAxis: [{
      type: "value",
      axisLine: {
        show: false,
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,.1)",
          width: 2,
        },
      },
    }, ],
    series: [{
        name: "种植业",
        type: "bar",
        barGap: 0,
        label: {},
        emphasis: {
          focus: "series",
        },
        data: [320, 332, 301, 334, 390],
        itemStyle: {
          normal: {
            //渐变色--------------------
            color: new echarts.graphic.LinearGradient(
              0,
              1,
              0,
              0,
              [{
                  offset: 0,
                  color: "#3dc7f7", // 0% 处的颜色
                },
                {
                  offset: 0.4,
                  color: "#52dadd", // 60% 处的颜色
                },
                {
                  offset: 1,
                  color: "#76fdae", // 100% 处的颜色
                },
              ],
              false
            ),
            // 圆柱radius------------------
          },
        },
        //圆柱宽度-----------------------------
        barWidth: "26%",
      },
      {
        name: "养殖业",
        type: "bar",
        label: {},
        emphasis: {
          focus: "series",
        },
        data: [220, 182, 191, 234, 290],
        itemStyle: {
          normal: {
            color: new echarts.graphic.LinearGradient(
              0,
              1,
              0,
              0,
              [{
                  offset: 0,
                  color: "#41c4f9", // 0% 处的颜色
                },
                {
                  offset: 0.4,
                  color: "#7cacf6", // 60% 处的颜色
                },
                {
                  offset: 1,
                  color: "#fe77ef", // 100% 处的颜色
                },
              ],
              false
            ),
          },
        },
        barWidth: "26%",
      },
    ],
  }
}
export function echart14(year, data) {
  return {
    legend: {
      x: "left", //x轴方向在左边显示
      // 距离底部距离设置
      left: "65%",
      top: "5%",
      //小图标宽度设置
      itemWidth: 10,
      itemHeight: 10,
      //图例组件文字样式
      textStyle: {
        color: "rgb(255,255,255,1)",
      },
    },
    tooltip: {
      trigger: "axis",
    },
    color: ['#c08460', '#36c1d4'],
    grid: {
      left: "5%",
      right: "5%",
      bottom: "5%",
      top: "20%",
      containLabel: true,
    },
    xAxis: {
      type: "category",
      axisTick: {
        show: false,
      },
      splitLine: {
        show: false,
      },
      axisLabel: {
        color: "#fff",
      },
      axisLine: {
        lineStyle: {
          color: "#0258b4",
          width: 1, //这里是为了突出显示加上的
        },
      },
      boundaryGap: false,
      data: year,
      splitLine: {
        show: false
      }, //去除网格线
    },
    yAxis: {
      show: true,
      type: "value",
      axisTick: {
        show: false,
      },
      splitLine: {
        show: false,
      },
      axisLine: {
        lineStyle: {
          color: "#0258b4",
          width: 1, //这里是为了突出显示加上的
        },
      },
      axisLabel: {
        color: "#fff",
      },
    },
    series: data,
  }
}
export function echart15() {
  return {
    tooltip: {
      trigger: "item",
      formatter: "{a} <br/>{b}: {c} ({d}%)",
    },
    legend: {
      icon: "pin",
      orient: "vertical",
      right: "0",
      top: "30%",
      textStyle: {
        color: "#00c0ee",
        fontSize: 16,
      },
    },

    series: [{
      color: ["#ffea00", "#ff701a", "#f89f6a", "#1d75f0", "#3fffea"],
      name: "行业类别",
      type: "pie",
      radius: ["30%", "60%"],
      center: ["30%", "50%"],
      roseType: "area",
      itemStyle: {
        borderRadius: 0,
      },
      label: {
        show: false,
      },
      data: [{
          value: 32,
          name: "党员"
        },
        {
          value: 30,
          name: "优秀共产党员"
        },
        {
          value: 28,
          name: "优秀党务工作者"
        },
      ],
    }, ],
  }
}
export function echart16(x, y) {
  return {
    tooltip: {
      trigger: "axis",
      axisPointer: {
        // 坐标轴指示器，坐标轴触发有效
        type: "shadow", // 默认为直线，可选为：'line' | 'shadow'
      },
    },
    grid: {
      top: "10%",
      left: "5%",
      right: "5%",
      bottom: "5%",
      containLabel: true,
    },
    axisLabel: {
      color: "#fff",
      fontSize: "12",
    },
    xAxis: [{
      type: "category",
      data: x,
      axisTick: {
        show: false,
      },
    }, ],
    yAxis: [{
      type: "value",
      axisLabel: {
        color: "#fff",
        fontSize: "12",
      },
      axisLine: {
        show: false,
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,.1)",
          width: 2,
        },
      },
      axisTick: {
        show: false,
      },
    }, ],
    series: [{
      type: "bar",
      barWidth: "60%",
      data: y,
      itemStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(
            0,
            1,
            0,
            0,
            [{
                offset: 0,
                color: "#41c4f9", // 0% 处的颜色
              },
              {
                offset: 0.4,
                color: "#7cacf6", // 60% 处的颜色
              },
              {
                offset: 1,
                color: "#fe77ef", // 100% 处的颜色
              },
            ],
            false
          ),
        },
      },
      barWidth: "26%",
    }, ],
  }
}
export function echart17(data) {
  return {
    tooltip: {
      trigger: "item",
      formatter: " {b}:{c}  ({d})%",
    },
    color: ["#3fecff", "#4c63f2", "#ed5400", "#d84986", "#fdd100"], //环形颜色
    series: [{
      name: "",
      type: "pie",
      radius: "50%",
      center: ["50%", "50%"],
      radius: ["25%", "40%"],
      labelLine: {
        //图形外文字线
        normal: {
          length: 25,
          length2: 60,
        },
      },
      label: {
        show: true,
        fontSize: "14",
        fontWeight: "normal",
        color: "#fff",
        formatter: " {b|{b}}      \n {c|{c}  {d}% } ", //图形外文字上下显示
        borderWidth: 20,
        borderRadius: 4,
        padding: [0, -60], //文字和图的边距
        rich: {
          b: {
            //name 文字样式
            fontSize: 14,
            lineHeight: 30,
          },
          c: {
            //value 文字样式
            fontSize: 14,
            lineHeight: 30,
            // color: 'red',
            align: "center",
          },
        },
      },
      data: data,
    }, ],
  }
}
export function echart18(data) {
  return {
    //图标颜色
    color: ["#2889fe", "#2cd1c0", "#ffa06c", "#fedb65"],
    tooltip: {
      trigger: "item",
    },
    legend: {
      // 距离底部距离设置
      right: "20%",
      left: "70%",
      bottom: "40%",
      //小图标宽度设置
      itemWidth: 12,
      itemHeight: 12,
      //图例组件文字样式
      textStyle: {
        color: "rgb(255,255,255,1)",
      },
    },
    series: [{
      name: "",
      type: "pie",
      //调整大小
      radius: ["40%", "70%"],
      //饼状图位置
      center: ["35%", "55%"],
      avoidLabelOverlap: false,
      label: {
        show: false,
        position: "center",
      },
      emphasis: {
        label: {
          show: false,
          fontSize: "40",
          fontWeight: "bold",
        },
      },
      labelLine: {
        show: false,
      },
      data: data,
    }, ],
  }
}
export function echart19(pxName, pxValue) {
  return {
    tooltip: {
      trigger: "axis",
      axisPointer: {
        // 坐标轴指示器，坐标轴触发有效
        type: "shadow", // 默认为直线，可选为：'line' | 'shadow'
      },
    },
    grid: {
      left: "5%",
      right: "5%",
      bottom: "0%",
      top: "5%",
      containLabel: true,
    },
    axisLabel: {
      color: "#fff",
      fontSize: "12",
    },
    xAxis: [{
      type: "category",
      data: pxName,
      axisTick: {
        alignWithLabel: true,
      },
    }, ],
    yAxis: [{
      type: "value",
      axisLabel: {
        color: "#fff",
        fontSize: "12",
      },
      axisLine: {
        show: false,
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,.1)",
          width: 2,
        },
      },
    }, ],
    series: [{
      type: "bar",
      barWidth: "60%",
      data: pxValue,
      itemStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(
            0,
            1,
            0,
            0,
            [{
                offset: 0,
                color: "#41c4f9", // 0% 处的颜色
              },
              {
                offset: 0.4,
                color: "#7cacf6", // 60% 处的颜色
              },
              {
                offset: 1,
                color: "#fe77ef", // 100% 处的颜色
              },
            ],
            false
          ),
          barBorderRadius: 4,
        },
      },
      barWidth: "26%",
    }, ],
  };
}
export function echart20() {
  return {
    legend: {
      x: "left", //x轴方向在左边显示
      // 距离底部距离设置
      left: "65%",
      top: "5%",
      //小图标宽度设置
      itemWidth: 10,
      itemHeight: 10,
      //图例组件文字样式
      textStyle: {
        color: "rgb(255,255,255,1)",
      },
    },
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow",
      },
    },
    axisLabel: {
      color: "#fff",
      fontSize: "12",
    },
    grid: {
      top: "20%",
      left: "5%",
      right: "5%",
      bottom: "5%",
      containLabel: true,
    },
    toolbox: {
      show: true,
      orient: "vertical",
      left: "right",
      top: "center",
    },
    xAxis: [{
      type: "category",
      axisTick: {
        show: false
      },
      data: ["初中及以下", "高中", "大专", "本科及以上"],
    }, ],
    yAxis: [{
      type: "value",
      axisLine: {
        show: false,
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,.1)",
          width: 2,
        },
      },
    }, ],
    series: [{
        name: "男性",
        type: "bar",
        barGap: 0,
        label: {},
        emphasis: {
          focus: "series",
        },
        data: [320, 332, 301, 334, 390],
        itemStyle: {
          normal: {
            //渐变色--------------------
            color: new echarts.graphic.LinearGradient(
              0,
              1,
              0,
              0,
              [{
                  offset: 0,
                  color: "#3dc7f7", // 0% 处的颜色
                },
                {
                  offset: 0.4,
                  color: "#52dadd", // 60% 处的颜色
                },
                {
                  offset: 1,
                  color: "#76fdae", // 100% 处的颜色
                },
              ],
              false
            ),
            // 圆柱radius------------------
          },
        },
        //圆柱宽度-----------------------------
        barWidth: "26%",
      },
      {
        name: "女性",
        type: "bar",
        label: {},
        emphasis: {
          focus: "series",
        },
        data: [220, 182, 191, 234, 290],
        itemStyle: {
          normal: {
            color: new echarts.graphic.LinearGradient(
              0,
              1,
              0,
              0,
              [{
                  offset: 0,
                  color: "#41c4f9", // 0% 处的颜色
                },
                {
                  offset: 0.4,
                  color: "#7cacf6", // 60% 处的颜色
                },
                {
                  offset: 1,
                  color: "#fe77ef", // 100% 处的颜色
                },
              ],
              false
            ),
          },
        },
        barWidth: "26%",
      },
    ],
  }
}